package com.yiji.fintech.musfinance.common.enums;

import com.google.common.collect.Maps;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 计算符号枚举
 * Created by ouwen@yiji.com} on 2017/8/8.
 */
public enum CalculateTypeEnum {

    GREATERTHAN("GREATERTHAN","大于"),
    GREATERTHANEQULES("GREATERTHANEQULES","大于等于"),
    LESSTHAN("LESSTHAN","小于"),
    LESSTHANEQULES("LESSTHANEQULES","小于等于"),
    EQULES("EQULES","等于"),
    UNLIMITED("UNLIMITED","无金额限制"),;

    CalculateTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    private String code;
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 获取全部枚举
     *
     * @return List<ChannelTypeEnum>
     */
    public static List<CalculateTypeEnum> getAllEnum() {
        List<CalculateTypeEnum> list = new ArrayList<CalculateTypeEnum>();
        for (CalculateTypeEnum _enum : values()) {
            list.add(_enum);
        }
        return list;
    }
    public static Map<String, String> mapping() {
        Map<String, String> map = Maps.newLinkedHashMap();
        for (CalculateTypeEnum type : values()) {
            map.put(type.getCode(), type.getMessage());
        }
        return map;
    }
}